

use crate::data::physics::*;






#[cfg(test)]
mod tests
{
    use super::*;
    use ::rand::Rng;
    use super::super::draw_for_test::*;
    use ::macroquad::prelude::*;

    #[macroquad::test]
    async fn test_draw_body()
    {
        let mut body = Body::default();
        let mut rng = ::rand::thread_rng();
        body.supported = false;
        body.mass = 2.33;
        body.gravity = body.mass * 9.8;// 9.8 is g
        body.position.x = rng.gen_range(0.0..100.0);
        body.position.y = rng.gen_range(0.0..100.0);
        body.shape.r#type = ShapeType::Rectangle(5.0, 5.0);

        let position = body.shape_position();
        let r = if let ShapePosition::Rectangle(r) = position {
            r
        } else { panic!() }; 


        loop
        {
            clear_background(BLACK);
            math::draw_rectangle(r, RED);
            next_frame().await
        }
    }
}







